from clinicalDiseases.models import ClinicalSystemModel, ClinicalDiseasesModel, ClinicalDiseaseContentModel
from rest_framework import serializers

# 临床决策序列化器
class ClinicalSystemModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = ClinicalSystemModel
        fields = [
            'id', 
            'name'
        ]

# 临床疾病序列化器
class ClinicalDiseasesModelSerializer(serializers.ModelSerializer):
    class Meta:
        model = ClinicalDiseasesModel
        fields = [
            'id', 
            'name', 
            'description', 
            'clinical'
        ]

# 临床疾病内容序列化器
class ClinicalDiseaseContentModelSerializer(serializers.ModelSerializer):
    disease = ClinicalDiseasesModelSerializer(read_only=True)

    class Meta:
        model = ClinicalDiseaseContentModel
        fields = [
            'id', 
            'content', 
            'disease', 
            'recomment_home'
        ]